package com.foreverwin.jzymes.report.pack.controller;

import com.foreverwin.jzymes.framework.base.AjaxResult;
import com.foreverwin.jzymes.framework.exception.BusinessException;
import com.foreverwin.jzymes.production.debur.domain.PackLog;
import com.foreverwin.jzymes.report.pack.service.IPackingReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/report/pack")
public class PackingReportController {
     @Autowired
     IPackingReportService   packingReportService;

     /**
     * 包装报表
     *
     * @param jsonMap
     * @return
     */
    @RequestMapping("/packReport")
    public AjaxResult packReport(@RequestParam Map<String,Object> jsonMap ){
        try{
            List<PackLog> packLogs = packingReportService.findpackingSearch( jsonMap );
            return AjaxResult.returnSuccess().put( "value", packLogs );
        }catch ( BusinessException e ) {
            return AjaxResult.returnError(e.getMessage());
        }
    }
}
